import { http } from "@/utils/http";
import baseUrlProxy from "@/api/baseUrlProxy";
import qs from "qs";

export const getNoticeList = (data?: object) => {
  return http.request<any>("get", baseUrlProxy + "/api/notice", {
    params: data,
    notNProgress: true,
    paramsSerializer: function (params: any) {
      return qs.stringify(params, { arrayFormat: "repeat" });
    }
  });
};

export const setNoticeRead = (data?: object) => {
  return http.request<any>("post", baseUrlProxy + "/api/notice/read", {
    data: data
  });
};

export const getNotReadList = (data?: object) => {
  return http.request<any>("get", baseUrlProxy + "/api/notice/unread", {
    params: data,
    notNProgress: true
  });
};
